#pragma once

#include <vector>

namespace Audio
{
	struct Point
	///////////////////////////////////////////////////////////////////////////////
	// Description: Points make up a graph
	//
	// Recent Changes:
	// -brasmuss 3/30/2007 : Created
	///////////////////////////////////////////////////////////////////////////////
	{
		Point(float x, float y) : m_x(x), m_y(y) {}
		bool operator<(const Point& rhs) { return m_x < rhs.m_x; }
		float	m_x;	//<! Position in domain
		float	m_y;	//<! Position in range
	};

	// TYPEDEFS
	typedef std::vector<Point>	pointlist_t;

	class Graph
	///////////////////////////////////////////////////////////////////////////////
	// Description: A series of points between 0 and 1 that map a parameter to
	//				to an output used for modulating volume, pitch, etc.
	//
	// Recent Changes:
	// -brasmuss 3/29/2007 : Created
	///////////////////////////////////////////////////////////////////////////////
	{
	public:
		Graph(std::string name);
		float Compute(float input);
		void AddPoint(float x, float y);
		void SortPoints();
		void ClearGraph() { m_points.clear(); }

		std::string		m_name;
		pointlist_t		m_points;
		float			m_min;		//<! Min value of domain
		float			m_max;		//<! Max value of domain
	};
}